home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1599 / 1256 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.7 KB

  1. From: Kay Roemer <roemer@informatik.uni-frankfurt.de>
  2. Posted-Date: Tue, 29 Mar 94 9:06:20 MESZ
  3. Received-Date: Tue, 29 Mar 94 09:06:20 +0200
  4. Message-Id: <9403290706.AA29864@hera.rbi.informatik.uni-frankfurt.de>
  5. Subject: Re: Mint 1.10: Bug in Fselect()
  6. To: nox@jelal.north.de (Juergen Lock)
  7. Date: Tue, 29 Mar 94 9:06:20 MESZ
  8. In-Reply-To: <9403212113.AA00065@jelal.north.de>; from "Juergen Lock" at Mar 21, 94 10:13 pm
  9. Mailer: Elm [revision: 70.85]
  10.  
  11. Juergen Lock writes:
  12.  
  13. [...]
  14.  
  15. >  ahaa so my last patch should better be changed like this?
  16. > Index: dosfile.c
  17. > @@ -1045,6 +1045,7 @@
  18. >      }
  19. >  
  20. >      if (count == 0) {
  21. > +        ulong onsigs;
  22. >          /* OK, now let's set a timeout */
  23. >  
  24. >          if (timeout) {
  25. > @@ -1057,6 +1058,7 @@
  26. >          sr = spl7();
  27. >  
  28. >      /* curproc->wait_cond changes when data arrives or the timeout happens */
  29. > +        onsigs = curproc->nsigs;
  30. >          while (curproc->wait_cond == (long)wakeselect) {
  31. >  #if 0
  32. >  /* better not call BIOS with interrupts off, especially not Bconin... :) */
  33. > @@ -1068,6 +1070,8 @@
  34. >                  check_sigs();
  35. >                  sr = spl7();
  36. >              }
  37. > +            if (onsigs != curproc->nsigs)
  38. > +                break;
  39. >          }
  40. >          spl(sr);
  41. >  
  42. >  or _must_ check_sigs run at level 7 here?  then stopping the modem1
  43. > receiver overruns could get a bit harder...
  44.  
  45. The only reason I can think of for the spl7()'s beeing there is to avoid
  46. race conditions with:
  47.  
  48.     while (curproc->wait_cond == (long)wakeselect) {
  49.         /* XXX */
  50.         sleep ();
  51.     }
  52.  
  53. because without them an interrupt handler could interrupt at /*XXX*/
  54. and clear curproc->wait_cond, thus making the process sleep forever,
  55. because it is woken up before actually going to sleep.
  56.  
  57. So running check_sigs() not at spl7 should be OK.
  58.  
  59. Cheers, Kay.
  60.